<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>

<title>Operation (randoop 4.1.0 API)</title>

<link rel="stylesheet" type="text/css" href="../../javadocstyle.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="Operation (randoop 4.1.0 API)";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../randoop/operation/NonreceiverTerm.html" title="class in randoop.operation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../randoop/operation/OperationParseException.html" title="class in randoop.operation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?randoop/operation/Operation.html" target="_top">Frames</a></li>
<li><a href="Operation.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">randoop.operation</div>
<h2 title="Interface Operation" class="title">Interface Operation</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../randoop/operation/ArrayCreation.html" title="class in randoop.operation">ArrayCreation</a>, <a href="../../randoop/operation/ArrayElementSet.html" title="class in randoop.operation">ArrayElementSet</a>, <a href="../../randoop/operation/CallableOperation.html" title="class in randoop.operation">CallableOperation</a>, <a href="../../randoop/operation/ConstructorCall.html" title="class in randoop.operation">ConstructorCall</a>, <a href="../../randoop/operation/EnumConstant.html" title="class in randoop.operation">EnumConstant</a>, <a href="../../randoop/operation/FieldGet.html" title="class in randoop.operation">FieldGet</a>, <a href="../../randoop/operation/FieldSet.html" title="class in randoop.operation">FieldSet</a>, <a href="../../randoop/operation/InitializedArrayCreation.html" title="class in randoop.operation">InitializedArrayCreation</a>, <a href="../../randoop/operation/MethodCall.html" title="class in randoop.operation">MethodCall</a>, <a href="../../randoop/operation/NonreceiverTerm.html" title="class in randoop.operation">NonreceiverTerm</a>, <a href="../../randoop/operation/ReflectionArrayCreation.html" title="class in randoop.operation">ReflectionArrayCreation</a>, <a href="../../randoop/operation/TypedClassOperation.html" title="class in randoop.operation">TypedClassOperation</a>, <a href="../../randoop/operation/TypedClassOperationWithCast.html" title="class in randoop.operation">TypedClassOperationWithCast</a>, <a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>, <a href="../../randoop/operation/TypedTermOperation.html" title="class in randoop.operation">TypedTermOperation</a>, <a href="../../randoop/operation/UncheckedCast.html" title="class in randoop.operation">UncheckedCast</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Operation</span></pre>
<div class="block">Operation represents the constructs that can occur in a statement as part of a test sequence.
 These include method calls, constructor calls, field accesses, enum constant values, or primitive
 values. They are used both as symbols in constructing statements as part of tests, and as a
 computational action in reflective execution of test sequences.

 <p>The concept of an operation comes from logic and universal algebra, where operations are used
 to build terms, which represent values. (To dive into the formality, see, e.g., the <a
 href="https://en.wikipedia.org/wiki/Term_algebra">Term Algebra</a> Wikipedia entry.)

 <p>An operation op has a type-signature op: [T1, T2, ..., Tn] &rarr; T, where [T1, T2, ..., Tn]
 is the list of input types, and T is the output type. The input types are represented by an
 ordered list of <a href="../../randoop/types/Type.html" title="class in randoop.types"><code>Type</code></a> objects, and the output type is a single <a href="../../randoop/types/Type.html" title="class in randoop.types"><code>Type</code></a> object.

 <p>For a non-static method call or an instance field access, the first input type is always the
 declaring class of the method or field. If we have a method <code>int A.m(double d)</code>, it is
 represented as an operation m : [A, double] &rarr; int. A value, such as an int or enum constant,
 can be represented as an operation with no input types, and its own type as the output type. So,
 the number 5 is represented by the operation 5 : [] &rarr; int. Non-class values are represented
 by <a href="../../randoop/operation/NonreceiverTerm.html" title="class in randoop.operation"><code>NonreceiverTerm</code></a> objects.

 <p>When an Operation is used in a statement the actual inputs have to be identified. Execution of
 the statement will call <a href="../../randoop/operation/CallableOperation.html#execute-java.lang.Object:A-java.io.PrintStream-"><code>CallableOperation.execute(Object[], PrintStream)</code></a> with concrete
 values for each of the inputs.

 <p>To support text-based serialization, an implementing class C should also provide:

 <ul>
   <li>A public static parse(String) method that returns a new Operation given a string
       description. The following property should hold: <code>C.parse(x.toParsableString()).equals(x)</code>
   <li>Update method OperationParser.parse(String) to parse operations of type C.
 </ul></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../randoop/sequence/Statement.html" title="class in randoop.sequence"><code>Statement</code></a>, 
<a href="../../randoop/sequence/ExecutableSequence.html#execute-randoop.ExecutionVisitor-randoop.test.TestCheckGenerator-"><code>ExecutableSequence.execute(randoop.ExecutionVisitor,
     randoop.test.TestCheckGenerator)</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#getName--">getName</a></span>()</code>
<div class="block">Returns the name for the operation.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#getValue--">getValue</a></span>()</code>
<div class="block">Returns the "value" of an operation that is actually a ground term, meaning a constant of some
 form.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isConstantField--">isConstantField</a></span>()</code>
<div class="block">Predicate to indicate whether this object represents a constant field.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isConstructorCall--">isConstructorCall</a></span>()</code>
<div class="block">Predicate to indicate whether object represents a call to a constructor.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isMessage--">isMessage</a></span>()</code>
<div class="block">Predicate to indicate whether object represents a method-call-like operation (either static or
 instance).</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isMethodCall--">isMethodCall</a></span>()</code>
<div class="block">Indicates whether this object represents a method-call operation (either static or instance).</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isNonreceivingValue--">isNonreceivingValue</a></span>()</code>
<div class="block">Predicate to indicate whether this object represents a value of a non-receiving type (includes
 numbers, strings, and null).</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isStatic--">isStatic</a></span>()</code>
<div class="block">Predicate to indicate whether object represents a static operation on the declaring class.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#isUncheckedCast--">isUncheckedCast</a></span>()</code>
<div class="block">Predicate to indicate whether this object represents an unchecked cast.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/operation/Operation.html#satisfies-randoop.reflection.ReflectionPredicate-">satisfies</a></span>(<a href="../../randoop/reflection/ReflectionPredicate.html" title="interface in randoop.reflection">ReflectionPredicate</a>&nbsp;reflectionPredicate)</code>
<div class="block">Determines whether the reflective object in this <a href="../../randoop/operation/Operation.html" title="interface in randoop.operation"><code>Operation</code></a> satisfies the <code>canUse</code>
 criteria of the given <a href="../../randoop/reflection/ReflectionPredicate.html" title="interface in randoop.reflection"><code>ReflectionPredicate</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="isStatic--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isStatic</h4>
<pre>boolean&nbsp;isStatic()</pre>
<div class="block">Predicate to indicate whether object represents a static operation on the declaring class.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if operation corresponds to static method or field of a class, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="isMessage--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMessage</h4>
<pre>boolean&nbsp;isMessage()</pre>
<div class="block">Predicate to indicate whether object represents a method-call-like operation (either static or
 instance). This includes field getters and setters, which are operations that access fields.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if operation is method-like, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="isMethodCall--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMethodCall</h4>
<pre>boolean&nbsp;isMethodCall()</pre>
<div class="block">Indicates whether this object represents a method-call operation (either static or instance).
 This excludes getters and setters.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this operation is a method call, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="isConstructorCall--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isConstructorCall</h4>
<pre>boolean&nbsp;isConstructorCall()</pre>
<div class="block">Predicate to indicate whether object represents a call to a constructor.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if operation is a constructor call, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="isConstantField--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isConstantField</h4>
<pre>boolean&nbsp;isConstantField()</pre>
<div class="block">Predicate to indicate whether this object represents a constant field.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this operation is a constant field, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="isNonreceivingValue--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNonreceivingValue</h4>
<pre>boolean&nbsp;isNonreceivingValue()</pre>
<div class="block">Predicate to indicate whether this object represents a value of a non-receiving type (includes
 numbers, strings, and null).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if object is a non-receiving value, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="isUncheckedCast--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isUncheckedCast</h4>
<pre>boolean&nbsp;isUncheckedCast()</pre>
<div class="block">Predicate to indicate whether this object represents an unchecked cast.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the this object is a cast, and false otherwise</dd>
</dl>
</li>
</ul>
<a name="getValue--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;getValue()</pre>
<div class="block">Returns the "value" of an operation that is actually a ground term, meaning a constant of some
 form. Only null if value is null, otherwise throws an exception if there is not a reasonable
 meaning of value for type of operation.

 <p>This is a hack to allow randoop.main.GenBranchDir to do mutation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>object reference to value</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if no meaningful definition of "value" for type</dd>
</dl>
</li>
</ul>
<a name="satisfies-randoop.reflection.ReflectionPredicate-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>satisfies</h4>
<pre>boolean&nbsp;satisfies(<a href="../../randoop/reflection/ReflectionPredicate.html" title="interface in randoop.reflection">ReflectionPredicate</a>&nbsp;reflectionPredicate)</pre>
<div class="block">Determines whether the reflective object in this <a href="../../randoop/operation/Operation.html" title="interface in randoop.operation"><code>Operation</code></a> satisfies the <code>canUse</code>
 criteria of the given <a href="../../randoop/reflection/ReflectionPredicate.html" title="interface in randoop.reflection"><code>ReflectionPredicate</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>reflectionPredicate</code> - a <a href="../../randoop/reflection/ReflectionPredicate.html" title="interface in randoop.reflection"><code>ReflectionPredicate</code></a> to be checked</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>result of applying reflectionPredicate to object</dd>
</dl>
</li>
</ul>
<a name="getName--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getName</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getName()</pre>
<div class="block">Returns the name for the operation.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the name for this operation</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../randoop/operation/NonreceiverTerm.html" title="class in randoop.operation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../randoop/operation/OperationParseException.html" title="class in randoop.operation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?randoop/operation/Operation.html" target="_top">Frames</a></li>
<li><a href="Operation.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
